package patrol.mobile.com.mobilepatrol.utils;

import android.content.Context;
import android.content.Intent;
import android.view.Gravity;
import android.widget.Toast;

import patrol.mobile.com.mobilepatrol.activity.road_survey.TrafficInvestBaseInfoActivity;
import patrol.mobile.com.mobilepatrol.activity.road_survey.TrafficInvestDetailActivity2;
import patrol.mobile.com.mobilepatrol.activity.road_survey.TrafficInvestDetailCatalogActivity;
import patrol.mobile.com.mobilepatrol.bean.RouteSurveyTaskStructBO;
import patrol.mobile.com.mobilepatrol.bean.TrafficInvestBaseInfo;

/**
 * Created by apple on 17/12/23.
 */

public class UIHelper {
    public final static String INVEST_INFO="invest_info";
    public final static String TASK_STRUCT_INFO ="task_struct";
    public final static String ATongzuxinxi ="AssetTongzuxinxi";
    /**
     * 跳转至 公路技术状况调查界面
     */
    public static void startTrafficInvestBaseInfoActivity(Context context, TrafficInvestBaseInfo info) {
        Intent intent=new Intent(context, TrafficInvestBaseInfoActivity.class);
        intent.putExtra(INVEST_INFO,info);
        context.startActivity(intent);
    }
    /**
     * 跳转至 路况调查明细目录 界面
     * @param context
     * @param baseInfo
     */
    public static void startInvestDetailCatalogActivity(Context context, TrafficInvestBaseInfo baseInfo) {
        Intent it=new Intent(context, TrafficInvestDetailCatalogActivity.class);
        it.putExtra(INVEST_INFO,baseInfo);
        context.startActivity(it);
    }
    /**
     * 跳转至 路况调查明细录入 界面
     */
    public static void startInvestDetailActivity(Context context, int pos,RouteSurveyTaskStructBO taskStruct, TrafficInvestBaseInfo investInfo){
        Intent it=new Intent(context, TrafficInvestDetailActivity2.class);
        it.putExtra(TASK_STRUCT_INFO,taskStruct);
        it.putExtra(INVEST_INFO,investInfo);
        it.putExtra("pos",pos);
        context.startActivity(it);
    }
    public static void ToastMessageCenter(Context cont,String msg){
        Toast toast=MyToast.makeText(cont, msg, Toast.LENGTH_SHORT);
        toast.setGravity(Gravity.CENTER, 0, 0);
        toast.show();
    }
}
